home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 January: Mac OS SDK / Dev.CD Jan 98 SDK2.toast / Development Kits (Disc 2) / QuickDraw GX / Programming Stuff / GX Libraries / TrueTypeLibrary.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-03-31  |  2.3 KB  |  73 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        TrueTypeLibrary.h
  3.     
  4.     Contains:    TrueType library definitions and routines 
  5.     
  6.     Written By:    Mike Reed
  7.     
  8.     Copyright:    ©1992-1995 by Apple Computer, Inc.  All rights reserved.
  9.     
  10.     Change History (most recent first):
  11.     
  12.          <1>      1/9/95    JD        First checked in.
  13.  
  14. */
  15.  
  16. #ifndef __TRUETYPELIBRARY__
  17. #define __TRUETYPELIBRARY__
  18.  
  19. #include <GXMath.h>
  20. #include <GXTypes.h>
  21.  
  22. #ifdef __cplusplus
  23. extern "C" {
  24. #endif
  25.  
  26. /* for compatibility with old headers */
  27. #define truetypeLibraryIncludes
  28.  
  29. #define fontHeaderTag            0x68656164    /* 'head' */
  30. #define horizontalHeaderTag        0x68686561    /* 'hhea' */
  31. #define indexToLocationTag        0x6c6f6361    /* 'loca' */
  32. #define maximumProfileTag        0x6d617870    /* 'maxp' */
  33. #define controlValueTag            0x63767420    /* 'cvt ' */
  34. #define preProgramTag            0x70726570    /* 'prep' */
  35. #define glyphDataTag            0x676c7966    /* 'glyf' */
  36. #define horizontalMetricsTag        0x686d7478    /* 'hmtx' */
  37. #define verticalMetricsTag        0x766d7478    /* 'vmtx' */
  38. #define fontProgramTag            0x6670676d    /* 'fpgm' */
  39. #define bitmapLocationTag        0x626c6f63    /* 'bloc' */
  40. #define bitmapDataTag            0x62646174    /* 'bdat' */
  41. #define glyphVariationTag            0x67766172    /* 'gvar' */
  42. #define cvtVariationTag            0x63766172    /* 'cvar' */
  43. #define accentAttachmentTag        0x61636e74    /* 'acnt' */
  44. #define postscriptGlyphNameTag    0x706f7374    /* 'post' */
  45. #define verticalHeaderTag        0x76686561    /* 'vhea' */
  46.  
  47. struct glyphBoundingBox {
  48.     short    xMin;
  49.     short    yMin;
  50.     short    xMax;
  51.     short    yMax;
  52. };
  53.  
  54. typedef struct glyphBoundingBox glyphBoundingBox;
  55.  
  56. void ComputeGlyphBBox(register glyphBoundingBox* bbox, const short xArray[], const short yArray[], int counter);
  57. long GetFontGlyphData(gxFont fontID, long index, void* userCopy);
  58. void SetFontGlyphData(gxFont fontID, long index, long length, void* data);
  59. void SetFontGlyphShape(gxFont fontID, long glyphIndex, gxShape pathOrPolygon);
  60.  
  61. /* These are experimental */
  62. long GetFontGlyphOutline(gxFont fontID, long glyphIndex, short* contourCount, short endPoint[], unsigned char onCurve[],
  63.     short xCoord[], short yCoord[], short* instructionCount, unsigned char instructions[], glyphBoundingBox* bbox);
  64. void SetFontGlyphOutline(gxFont fontID, long glyphIndex, long contourCount, const short endPoint[], const unsigned char onCurve[],
  65.     const short xCoord[], const short yCoord[], long instructionCount, const unsigned char instructions[], const glyphBoundingBox* bbox);
  66.  
  67. #ifdef __cplusplus
  68. }
  69. #endif
  70.  
  71. #endif /* __TRUETYPELIBRARY__ */
  72.  
  73.